<div class="row-fluid">
    <div class="box span12">
        <div class="box-header">
            <h2><i class="icon-user"></i><span class="break"></span>
                <?php echo isset($_GET['pk']) ? 'Edit Category Name' : 'Create Edit Category Name'; ?>
            </h2>            
        </div>

        <div class="box-content">
            <div class="row-fluid">
                <?php if (Yii::app()->user->hasFlash('Success_edit')): ?>
                    <div class="alert alert-success">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>All done!</strong> <?php echo Yii::app()->user->getFlash('Success_edit'); ?>
                    </div>
                    <?php // endif; ?>
                <?php elseif (Yii::app()->user->hasFlash('Error_edit')): ?>
                    <div class="alert alert-error">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>Failed!</strong> <?php echo Yii::app()->user->getFlash('Error_edit'); ?>
                    </div>
                <?php endif; ?>

<!--                <a class="btn btn-prev" href="<?php echo Yii::app()->request->urlReferrer; ?>">
                    <i class="icon-arrow-left"></i> Back
                </a>-->

                <?php
                $form = $this->beginWidget('CActiveForm', array(
                    'id'                     => 'user-create-form',
//                    'enableAjaxValidation' => true,
                    'enableClientValidation' => true,
                    'htmlOptions'            => array(
                        'class'   => 'form-horizontal',
                        'enctype' => 'multipart/form-data',
                    ),
                    'focus'                  => array($model, 'name'),
                    'clientOptions'          => array(
                        'validateOnSubmit' => true,
                    ),
                ));
                ?>
                <?php echo CHtml::errorSummary($model); ?>
                <fieldset>
                    <div class="span6">                        
                        <div class="control-group">
                            <?php echo $form->labelEx($model, 'name', array('class' => 'control-label')); ?>
                            <div class ="controls">
                                <?php echo CHtml::hiddenField('ajax', 'ajax-create'); ?>
                                <?php
                                echo $form->textField($model, 'name', array(
                                    'placeholder' => $model->getAttributeLabel('name'),
                                    'class'       => 'input-file uniform_on input-reset'
                                ));
                                ?>
                                <font color="red"><?php echo $form->error($model, 'name'); ?></font>
                            </div>
                        </div>
                    </div>

                    <div class="clearfix"></div>
                    <hr>
                    <?php
                    echo CHtml::submitButton('Save', array('class' => 'btn btn-primary'));
                    ?>
                    <?php echo CHtml::resetButton('Reset', array('class' => 'btn', 'id' => 'btn-reset')); ?>
                </fieldset>
                <?php $this->endWidget(); ?>
            </div>
        </div>
    </div>
</div>

